package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.controller.request.EcologyHatchIdPageRequest;
import com.sc.nft.entity.vo.ecology.UserEcologyCastUpperLimitDetailsVO;
import com.sc.nft.pool.UserPool;
import com.sc.nft.service.UserEcologyHatchUpperLimitDetailsService;
import com.sc.nft.sup.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author 朱梦晨
 * @Description: 熔炼上限
 * @date 2024-08-14
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/ecology/upperLimit")
@Api(tags = "熔炼上限记录")
public class UserEcologyHatchUpperLimitController {


    private final UserEcologyHatchUpperLimitDetailsService userEcologyHatchUpperLimitDetailsService;



    @ApiOperation(value = "熔炼兑换上限记录", notes = "熔炼兑换上限记录", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/userEcologyHatchUpperLimitDetails", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public PageResult<UserEcologyCastUpperLimitDetailsVO> userEcologyHatchUpperLimitDetails(@Valid @RequestBody EcologyHatchIdPageRequest request){
        return PageResult.success(userEcologyHatchUpperLimitDetailsService.userEcologyHatchUpperLimitDetails(UserPool.getUser(),request.getId(),request.getPageNo(),request.getPageSize()));
    }

}
